//
//  JKViewController.m
//  MVCTest
//
//  Created by 王冲 on 2018/9/29.
//  Copyright © 2018年 JK科技有限公司. All rights reserved.
//

#import "JKViewController.h"
#import "JKView.h"
#import "JKModel.h"
@interface JKViewController ()


@end

@implementation JKViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    /**
        优点：View、Model 可以重复利用，可以独立使用
        缺点：Controller的代码过于臃肿
     */
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    JKView *jkView = [[JKView alloc]initWithFrame:CGRectMake(50, 200, [UIScreen mainScreen].bounds.size.width-100, 100)];
    jkView.backgroundColor = [UIColor brownColor];
    [self.view addSubview:jkView];
    
    JKModel *model = [JKModel new];
    model.name = @"传统的MVC";
    
    jkView.label.text = model.name;
    
    
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
